package com.xd.navi;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.util.Log;

import java.util.Objects;

public class NetworkReceive extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        if (Objects.equals(intent.getAction(), ConnectivityManager.CONNECTIVITY_ACTION)) {
            Log.d("NetworkStateReceive","network state = " + NetworkUtils.isConnected());
            NetWorkManager.getInstance().notifyNetStateChange(NetworkUtils.isConnected());
        }
    }
}
